package com.devframe.sysbase.model;

import com.devframe.sys.encrypt.KeyEncryptor;
import com.devframe.sysbase.model.base.BaseTSysParameter;



public class TSysParameter extends BaseTSysParameter {
	private static final long serialVersionUID = 1L;

/*[CONSTRUCTOR MARKER BEGIN]*/
	public TSysParameter () {
		super();
	}

	/**
	 * Constructor for primary key
	 */
	public TSysParameter (java.lang.String paramCode) {
		super(paramCode);
	}

/*[CONSTRUCTOR MARKER END]*/

	/**
	 * getDisplayValue 参数显示值
	 * 如果加密参数显示为*******，否则显示原参数值
	 * @return String
	 * 
	 */
	public String getDisplayValue(){
	    if("1".equals(this.getNeedEncrypt())){
	        return "********";
	    }
	    return this.getParamValue();
	}
	/**
	 * getDecryptValue 获取实际参数值
	 * @return 参数值，如果有加密则解密
	 * 
	 */
	public String getValue(){
	    if("1".equals(this.getNeedEncrypt())){
            return KeyEncryptor.decrypt(this.getParamValue());
        }
        return this.getParamValue();
	}

}